<?php
/**
 * 
 * @author canhpc2
 *
 */
class cms_View_Helper_Breadcrumb{
	public $view;
	
	public function breadcrumb($data = null, $partial = 'breadcrumb.phtml')
	{
	    $result = array();
	    if(is_array($data) && count($data) > 0) {
	        foreach ($data as $d) {
	            $item['url'] = $d['url'];
	            $item['name'] = $d['displayName'];
	            $item['title'] = $d['title'];
	            $result[] = $item;
	        }
	    }
		/**
		 * tranfer data to view
		 */
		$pages->result = $result;
		
		return $this->view->partial($partial, $pages);
	}

	public function setView(Zend_View_Interface $view)
	{
		$this->view = $view;		
	}

}